package cultu.core.service;

import org.granite.messaging.service.annotations.RemoteDestination;

import cultu.core.message.Role;
import cultu.core.message.RoleCriteria;
import cultu.core.message.RoleList;
import cultu.core.message.RoleScenario;
import cultu.core.message.Context;

/**
 * The Interface RoleManager.
 */
@RemoteDestination(id="roleManager", channel="my-amf")
public interface RoleManager
{
  
  /**
   * Gets the role.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pRole the role
   * @return the role
   */
  public Role getRole(Context pContext, RoleScenario pScenario, Role pRole);

  /**
   * Creates the role.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pRole the role
   * @return the role
   */
  public Role createRole(Context pContext, RoleScenario pScenario, Role pRole);

  /**
   * Delete role.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pRole the role
   * @return the role
   */
  public Role deleteRole(Context pContext, RoleScenario pScenario, Role pRole);

  /**
   * Update role.
   *
   * @param pContext the context
   * @param pScenario the scenario
   * @param pRole the role
   * @return the role
   */
  public Role updateRole(Context pContext, RoleScenario pScenario, Role pRole);

    /**
     * Find roles.
     *
     * @param pContext the context
     * @param pScenario the scenario
     * @param pCriteria the criteria
     * @return the role list
     */
    public RoleList findRoles(Context pContext, RoleScenario pScenario, RoleCriteria pCriteria);

    /**
     * Delete roles.
     *
     * @param pContext the context
     * @param pScenario the scenario
     * @param pList the list
     * @return the role list
     */
    public RoleList deleteRoles(Context pContext, RoleScenario pScenario, RoleList pList);

    /**
     * Creates the roles.
     *
     * @param pContext the context
     * @param pScenario the scenario
     * @param pList the list
     * @return the role list
     */
    public RoleList createRoles(Context pContext, RoleScenario pScenario, RoleList pList);

    /**
     * Update roles.
     *
     * @param pContext the context
     * @param pScenario the scenario
     * @param pList the list
     * @return the role list
     */
    public RoleList updateRoles(Context pContext, RoleScenario pScenario, RoleList pList);
    
    /**
     * Gets the role by code.
     *
     * @param code the code.
     * @return the customer role.
     */
    public Role getRoleByCode(final String code);
}
